#!/bin/bash
data_file="data.txt"
echo "相同IP中的不同学号："
grep -oP '(?<=client: )\d+\.\d+\.\d+\.\d+' "$data_file" | sort | uniq -d |
while read -r ip; do
    echo "IP地址: $ip"
    grep -oP "(?<=client: $ip request: \"GET \/lab2\/)\d+" "$data_file" | sort -u
done

echo "学号（number）："
grep -oP '(?<=GET \/lab2\/)\d+' "$data_file" | sort -u